<template>
  <div class="bannerWrap">
    <div class="newCenter_topwrap">
      <img class="imgSgin" src="~img/ymtCenter_topsginImg_03.png">
      <div class="newCenter_topCont">
          <div class="newCenter_topCont1">原仓授权一码通</div>
          <div class="newCenter_topCont2">你的智能授权管家</div>
          <div class="newCenter_topCont3">
            <el-button class="ymt-askforcode" type="buttton" @click="dialogVisible = true">立即申请授权码</el-button>
          </div>
      </div>
    </div>
    <el-dialog
      title="立即申请授权码"
      custom-class="askForCodeWrapper"
      top="-98px"
      :visible.sync="dialogVisible">
      <span slot="footer" class="dialog-footer">
        <el-button @click.stop.prevent="ipAurl">已有IP，直接授权</el-button>
        <el-button type="primary" @click="newAddCoryRight">新增版权</el-button>
      </span>
    </el-dialog>
    <newadd-coryright ref="newCoryRight"></newadd-coryright>
  </div>
</template>

<script>
import NewaddCoryright from 'pages/commons/NewaddCoryright'
export default {
  name: 'UindexBanner',
  components: {
    NewaddCoryright
  },
  data () {
    return {
      dialogVisible: false
    }
  },
  methods: {
    ipAurl () {
      window.location.href = 'https://ipyimatong.com/web/applycode/rightchange.jsp'
    },
    newAddCoryRight () {
      this.$refs['newCoryRight'].dialogNewCoryrightFormVisible = true
      let lthisVal = this
      setTimeout(function () {
        lthisVal.dialogVisible = false
      }, 10)
    }
  }
}
</script>

<style lang="stylus">
@import '~styles/varibles.styl'
.askForCodeWrapper {
  width: 410px;
  height: 195px;
  border: 4px solid #fff;
  border-radius: 8px;
  margin: 0 auto;
  top: 50%;
}
.askForCodeWrapper .el-dialog__header {
  height: 45px;
  border-bottom: 1px solid #f2f2f2;
  background-color: #fff;
  padding: 0 10px 0 18px;
}
.askForCodeWrapper .el-dialog__header .el-dialog__title {
  line-height: 44px;
  color: #333333;
  font-size: 16px;
}
.askForCodeWrapper .el-dialog__header .el-dialog__headerbtn {
  position: absolute;
  top: 10px;
  right: 14px;
  padding: 0;
  border: none;
  outline: 0;
  background: 0 0;
  font-size: 16px;
  width: 24px;
  height: 24px;
  cursor: pointer;
}
.askForCodeWrapper .el-dialog__header .el-dialog__headerbtn .el-dialog__close {
  color: rgb(189, 189, 189);
  width: 24px;
  height: 24px;
  font-size: 24px;
}
.askForCodeWrapper .el-dialog__body {
    position: relative;
    padding: 0;
    color: #333333;
    font-size: 14px;
    height: 50px;
}

.askForCodeWrapper .el-dialog__footer {
    padding: 0;
    text-align: center;
}
.askForCodeWrapper .el-dialog__footer .el-button {
  width: 160px;
  height: 40px;
  padding: 0;
  text-align: center;
  border: 1px solid #E6E6E6;
  border-radius: 4px;
  color: #333333;
  font-size: 14px;
}
.askForCodeWrapper .el-button:focus,.askForCodeWrapper .el-button:hover {
    color: #333333;
    border-color: #E6E6E6;
    background-color: #fff;
}
.askForCodeWrapper .el-dialog__footer .el-button--primary {
    color: #FFF;
    background-color: $baseColor;
    border-color: $baseColor;
    margin-left: 20px;
}
</style>

<style lang="stylus" scoped>
.bannerWrap
  padding 0 20px 0
.newCenter_topwrap
  margin-bottom 20px
  position relative
  width 100%
  height 280px
  background url('~img/ymtCenter_topbottombg_03.png') left top no-repeat
  background-size cover
  overflow hidden
  .imgSgin
    width 397px
    position absolute
    bottom -25px
    right 13%
  .newCenter_topCont
    position absolute
    top 50%
    left 9.8%
    margin-top -87px
  .newCenter_topCont1
    line-height 50px
    color #fff
    font-size 34px
  .newCenter_topCont2
    line-height 46px
    color #fff
    font-size 36px
    margin-bottom 30px
    font-weight 300
  .newCenter_topCont3
    .ymt-askforcode
      width 200px
      height 48px
      line-height 48px
      text-align center
      background-color #ffaf15
      font-size 16px
      color #FFFFFF
      border-radius 4px
      border 0
      padding 0
</style>
